<?php
// +----------------------------------------------------------------------
// | Author:
// +----------------------------------------------------------------------
// | 创建时间: 2023-12-27 20:26:52
// +----------------------------------------------------------------------
// | cms页面分类
// +----------------------------------------------------------------------

namespace july\julyadmin\common\model;

use think\Model;
use think\model\concern\SoftDelete;

class CmsPagesCategory extends Model
{

    use SoftDelete;
    //主键
    protected $pk = 'id';
    //设置自动时间写入类型
    protected $autoWriteTimestamp = 'datetime';
    //设置创建时间字段
    protected $createTime = 'create_time';
    //设置更新时间字段
    protected $updateTime = 'update_time';
    //设置删除时间字段
    protected $deleteTime = 'delete_time';

    /**
     * 上级分类
     * @Author   July
     * @DateTime 2024-01-13T20:18:12+0800
     */
    public function parent()
    {
        return $this->belongsTo(CmsPagesCategory::class, 'parent_id', 'id');
    }

}
